summaryrefslogtreecommitdiffhomepage
path: root/packages/console/app/src/routes/workspace/[id]/usage/index.tsx
blob: 3a9c8db2961904c6a9ab3dbbde06ba3240253041 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { Show } from "solid-js"
import { createAsync, useParams } from "@solidjs/router"
import { GraphSection } from "./graph-section"
import { UsageSection } from "./usage-section"
import { querySessionInfo } from "../../common"

export default function () {
  const params = useParams()
  const user = createAsync(() => querySessionInfo(params.id!))

  return (
    <div data-page="workspace-[id]">
      <div data-slot="sections">
        <Show when={user()?.isAdmin}>
          <GraphSection />
        </Show>
        <UsageSection />
      </div>
    </div>
  )
}